<?xml version="1.0" encoding="UTF-8"?>

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html">
    
    <ui:composition template="/pages/user/templates/userAdminTemplate.xhtml">
        <ui:define name="pageTitle">
            <h:outputText value="Manage Roles"/>
        </ui:define>
    
        <ui:define name="centerPane">
            <h:form>
                <h:commandButton value="create" action="gotoCreateRole"/>
                <h:dataTable value="#{manageRolesAction.roles}" var="role" styleClass="dataTable">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Role ID"/>
                        </f:facet>
                        <h:outputText value="#{role.roleId}"/>
                    </h:column>
                    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Role Name"/>
                        </f:facet>
                        <h:outputText value="#{role.roleName}"/>
                    </h:column>
                    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Role Description"/>
                        </f:facet>
                        <h:outputText value="#{role.roleDescription}"/>
                    </h:column>
                    
                    <h:column>
                        <h:outputLink value="#{context}/pages/user/admin/editRole.jsf">
                            <f:param name="roleId" value="#{role.roleId}"/>
                            <h:outputText value="#{msg['role.edit.label']}"/>
                        </h:outputLink>
                    </h:column>
                    
                    <h:column>
                        <h:outputLink value="#{context}/pages/user/admin/deleteRole.jsf">
                            <f:param name="roleId" value="#{role.roleId}"/>
                            <h:outputText value="#{msg['role.delete.label']}"/>
                        </h:outputLink>
                    </h:column>
                </h:dataTable>
                <h:commandButton value="create" action="gotoCreateRole"/>
            </h:form>
        </ui:define>
    </ui:composition>
    
</html>
